<template>
  <div>
    <!-- 卡片视图 插入表格 -->
    <el-card class="box-card">
      <el-form v-if="firstFormFlag">
        <el-form-item :class="firstClass.input1">
          <el-input size="mini" :placeholder="firstClass.input1Placeholder"></el-input>
        </el-form-item>
        <el-form-item :class="firstClass.button">
          <el-button type="info" :class="firstClass.button1" size="mini" :icon="firstClass.button1Icon">重置</el-button>
          <el-button type="primary" :class="firstClass.button2" size="mini" :icon="firstClass.button2Icon">搜索</el-button>
          <el-button type="success" :class="firstClass.button3" size="small" :icon="firstClass.button3Icon">新增用户</el-button>
        </el-form-item>
      </el-form>
      <el-alert
        v-if="alertFlag"
        type="info"
        :title="alertTitle"
        show-icon
        :closable="false"></el-alert>
      <tables :tableNeedData="tableNeedData" />
      <pageNum
        :total="total"
        :pagenum="params.page"
        :pagesize="params.pagesize"
        @changePageSize="changePageSize"
        @changePageNum="changePageNum" />
    </el-card>
  </div>
</template>

<script>
import pageNum from './pageNum.vue'
import tables from './table.vue'
export default {
  components: {
    tables,
    pageNum
  },
  props: ['alertFlag', 'alertTitle', 'firstClass', 'firstFormFlag', 'tableNeedData', 'total', 'params'],
  data () {
    return {

    }
  },

  created () {

  },

  methods: {
    changePageSize (val) {
      console.log(val)
      this.$parent.changePageSize(val)
    },
    changePageNum (val) {
      console.log(val)
      this.$parent.changePageNum(val)
    }
  }
}
</script>

<style scoped lang='less'>

</style>
